class DelSyr extends Mutator;

event PreBeginPlay()
{
	SetTimer(5,true);
}
 
function Timer()
{
	local Controller C;
	for (C = Level.ControllerList; C != None; C = C.NextController)
	{	
		if(C.IsA('PlayerController') && C.Pawn!=none)
		{
			ModifyPawn(C.Pawn);
			//Log(C.Pawn.OwnerName@"location="$C.Pawn.Location@Location@"Velocity="$C.Pawn.Velocity);
		}
	}
}

function ModifyPawn(Pawn Other)
{
	local inventory Inv;
	local int flamersCount;
	local int shotgunCount;
	local int boomStickCount;
	if(Other.PlayerReplicationInfo.bAdmin) return;
	//Other.Weapon=Class'KFMod.Knife';
	if( Other!=None && Other.Inventory!=None )
	{
		flamersCount=0;
		shotgunCount=0;
		boomStickCount=0;
		for(inv=Other.Inventory; inv!=None; inv=inv.Inventory )
		{
 			if( FlameThrowerW(inv)!=None || SFlameThrowerW(inv)!=None )
			{
				flamersCount++;
				if ( flamersCount>1 && KFWeapon(inv) != none && !KFWeapon(inv).bKFNeverThrow )
				{
					inv.Velocity = Velocity;
					inv.DropFrom(Other.Location + VRand() * 160);
				}
			} 

			if( Knife(inv)!=None || Single(inv)!=None || Deagle(inv)!=None )
			{
				Other.DeleteInventory(inv);
			}

/* 			if( ShotgunW(inv)!=None || SShotgunW(inv)!=None )
			{
				shotgunCount++;
				if ( shotgunCount>1 && KFWeapon(inv) != none && !KFWeapon(inv).bKFNeverThrow )
				{
					inv.Velocity = Velocity;
					inv.DropFrom(Other.Location + VRand() * 160);
				}
			}
 *//* 			if( BoomStickW(inv)!=None || SBoomStickW(inv)!=None || SawedOffW(inv)!=None )
			{
				boomStickCount++;
				if ( boomStickCount>2 && KFWeapon(inv) != none && !KFWeapon(inv).bKFNeverThrow )
				{
					inv.Velocity = Velocity;
					inv.DropFrom(Other.Location + VRand() * 160);
				}
			} */

			if( HuntingRifleW(inv)!=None || FireAxeW(inv)!=None || SKatanaW(inv)!=None || 
				SChainsawW(inv)!=None  || BanHammerW(inv)!=None || 
				LethalInjectionW(inv)!=None || MP7M2W(inv)!=None || 
				M79FlameW(inv)!=None || AFS12W(inv)!=None || SCrossbowW(inv)!=None ||
				SShotgunW(inv)!=None
				)
			{
				if(Other.PlayerReplicationInfo != None)
				{
					if(KFPlayerReplicationInfo(Other.PlayerReplicationInfo).ClientVeteranSkillLevel <11 )
					{
						//Other.DeleteInventory(Inv);
						if ( KFWeapon(inv) != none && !KFWeapon(inv).bKFNeverThrow )
						{
							inv.Velocity = Velocity;
							inv.DropFrom(Other.Location + VRand() * 160);
						}
					}
				}
			}

			if( SWelderW(inv)!=None || M56W(inv)!=None || SCAR19W(inv)!=None )
			{
				if(Other.PlayerReplicationInfo != None)
				{
					if(KFPlayerReplicationInfo(Other.PlayerReplicationInfo).ClientVeteranSkillLevel <11 )
					{
						KFWeapon(Inv).bKFNeverThrow=false;
						Other.DeleteInventory(Inv);
					}
				}
			}

			if(		AcidGunW(inv)!=None || SVDW(inv)!=None || 
					M32ClusterBombW(inv)!=None || 
					SFlameThrowerW(inv)!=None
					)
			{
				if(Other.PlayerReplicationInfo != None)
				{
					if(KFPlayerReplicationInfo(Other.PlayerReplicationInfo).ClientVeteranSkillLevel <12 )
					{
						if ( KFWeapon(inv) != none && !KFWeapon(inv).bKFNeverThrow )
						{
							inv.Velocity = Velocity;
							inv.DropFrom(Other.Location + VRand() * 160);
						}
					}
				}
			}
			
			if( HuskGunClusterW(inv)!=None || SBoomStickW(inv)!=None || RaijinW(inv)!=None)
			{
				if(Other.PlayerReplicationInfo != None)
				{
					if(KFPlayerReplicationInfo(Other.PlayerReplicationInfo).ClientVeteranSkillLevel <12 )
					{
						KFWeapon(Inv).bKFNeverThrow=false;
						Other.DeleteInventory(Inv);
					}
				}
			}

			if( BomberW(inv)!=None || RPGW(inv)!=None || MG34W(inv)!=None || 
				ColtW(inv)!=None || PKM(inv)!=None || ProtectaW(inv)!=None )
			{
				if(Other.PlayerReplicationInfo != None)
				{
					if(KFPlayerReplicationInfo(Other.PlayerReplicationInfo).ClientVeteranSkillLevel <13 )
					{
						KFWeapon(Inv).bKFNeverThrow=false;
						Other.DeleteInventory(Inv);
					}
				}
			}
		}
	}
}

defaultproperties
{
     bAddToServerPackages=True
     GroupName="KFWUpgrade"
     FriendlyName="Syringe Remover"
     Description="Remove the Syringe on Start."
}
